---
category: Level 1 — Basic
created: '2020-02-17'
keywords:
title: Show or hide an element
---

## Show an element

```js
ele.style.display = '';
```

## Hide an element

```js
ele.style.display = 'none';
```

## See also

-   [Detect if the caps lock is on](https://phuoc.ng/collection/html-dom/detect-if-the-caps-lock-is-on/)
-   [Get size of the selected file](https://phuoc.ng/collection/html-dom/get-size-of-the-selected-file/)
-   [Set css style for an element](https://phuoc.ng/collection/html-dom/set-css-style-for-an-element/)
-   [Show a loading indicator when an iframe is being loaded](https://phuoc.ng/collection/html-dom/show-a-loading-indicator-when-an-iframe-is-being-loaded/)
-   [Toggle an element](https://phuoc.ng/collection/html-dom/toggle-an-element/)
